package window;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JWindow;

import utils.Util;

public class SplashScreen extends JWindow{

	  protected ImageIcon logo;
	  protected JLabel productName;

	  public SplashScreen()
	  {
	    ClassLoader localClassLoader = getClass().getClassLoader();
	    this.logo = new ImageIcon(localClassLoader.getResource("icons/logo.gif"));
	    this.productName = new JLabel("<html><font face=\"Verdana\" size=10>SocketTest v 3.0.0", this.logo, 0);
	    this.productName.setOpaque(true);
	    this.productName.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), BorderFactory.createLineBorder(Color.black)));
	    getContentPane().add(this.productName);
	    Dimension localDimension = this.productName.getPreferredSize();
	    localDimension.setSize(localDimension.getWidth() + 10.0D, localDimension.getHeight() + 10.0D);
	    setSize(localDimension);
	    Util.centerWindow(this);
	    setVisible(true);
	  }

	  public void kill()
	  {
	    dispose();
	  }
}
